package com.crp.unitalinforbaseplat.app.core.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * @program: squarenavigationsys
 * @description:时间工具类
 * @author: chenzhicai
 * @create: 2018-11-14-16-17
 **/
public class DateUtil {
    public static final String FORMAT_YYYY_MM_DD = "yyyy-MM-dd";
    public static final String FORMAT_YYYYMMDD = "yyyyMMdd";
    public static final String FORMAT_YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
    public static final String FORMAT_YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";

    public DateUtil() {
    }

    public static final Date getSysDate() {
        return Calendar.getInstance().getTime();
    }

    public static final String dateToStr(Date date, String format) {
        SimpleDateFormat sdf = new SimpleDateFormat(format);
        return sdf.format(date);
    }
}

    